<script type="text/javascript">

    var $componentDialog = $.pdialog.getCurrent();
    
    function componentValidateCallback() {    	
        var $form = $("#operationCapacityForm");
        if (!$form.valid()) {
            return false;
        }        
        var standardCapacity = $("input[name='standardCapacity']",$.pdialog.getCurrent()).val();
		var standardHours = $("input[name='standardHours']",$.pdialog.getCurrent()).val();
		if(""!=standardCapacity && ""===standardHours){
			alertMsg.error("标准用时不能为空！");
			return false;
		}
		if(""==standardCapacity && ""!=standardHours){
			alertMsg.error("标准产能不能为空！");
			return false;
		}
		var data = [];
        data["workUnitCode"] = $("input#operationComponentLookup\\.workUnitCode").val();
        data["workUnitText"] = $("input#operationComponentLookup\\.workUnitText").val();
        data["standardCapacity"] =standardCapacity;
        data["standardHours"] = standardHours;
        var popId = $("input[name='popId']",$.pdialog.getCurrent()).val();
        if(popId && popId != "")
            data["processOperationID"] = popId;
        _addProcessCapacity(data);
        $.pdialog.close($componentDialog);
    }
</script>
    <form id="operationCapacityForm" method="post" action="" class="pageForm required-validate">
        <div class="pageContent">
        <div class="pageFormContent" layoutH="56">
         <input type="hidden" name="popId" value="${popId!''}">
            <fieldset>
            <dl class="notnormal">
                <dt><@label key="workUnitCode.C,colon">作业单元编号</@label></dt>
                <dd>
                    <input class="required look" id="operationComponentLookup.workUnitCode" 
                    name="workUnitCode" type="text" postField="workUnitCode" 
                    suggestFields="workUnitCode,workUnitText" 
                    suggestUrl="${rc.getContextPath()}/manage/workUnit/workUnitSuggest" 
                    lookupGroup="operationComponentLookup"
                    remote="${rc.getContextPath()}/manage/workUnit/chckWorkUnitCode" 
                    warn="<@label key='unitNotExist.M'>作业单元不存在！</@label>"/>
                    <a class="btnLook" href="${rc.getContextPath()}/manage/workUnit/workUnitLookUp?lookupType=radio" 
                    rel="operationComponentl_dialog"
                     title="<@label key='select.C,workUnitCode.C'>选择作业单元</@label>" 
                     lookupGroup="operationComponentLookup" ></a>                                          
                    
                </dd>
            </dl>
            <dl>
                <dt><@label key="workUnitText.C,colon">作业单元名称</@label></dt>
                <dd><input readonly="readonly" type="text" id="operationComponentLookup.workUnitText" name="workUnitText" /></dd>
            </dl>
            </fieldset>
            <dl class="nowrap">
                <dt><@label key="standardCapacity.C,colon">标准产能</@label></dt>
                <dd>
                    <input  name="standardCapacity" size="22" type="text" class="number" min="1" maxlength="9" />
                </dd>
              <dl>
              <dl class="nowrap">
                   <dt><@label key="standardHours.C,colon">标准用时</@label></dt>
                   <dd>
                       <input name="standardHours" size="22" type="text" class="number" min="1" maxlength="9" />
                   </dd>
               <dl>
        </div>
        <div class="formBar">
            <ul>
                <li><div class="buttonActive"><div class="buttonContent" onclick="componentValidateCallback();"><button type="button">保存</button></div></div></li>
                <li>
                    <div class="buttonActiveGrey"><div class="buttonContent"><button type="button" class="close"><@label key="cancel.B">取消</@label></button></div></div>
                </li>
            </ul>
        </div>
        </div>
    </form>

